local chongxu = fk.CreateSkill {

  name = "joy__chongxu",

  tags = { Skill.Limited, },

}



chongxu:addEffect("active", {
  name = "joy__chongxu",
  anim_type = "special",
  frequency = Skill.Limited,
  card_num = 0,
  target_num = 0,
  prompt = function(self)
    local n = math.min(player:getMark("joy__sunhanhua_ling"),#Fk:currentRoom().players)
    return "#joy__chongxu:::"..n
  end,
  can_use = function(self, player)
    return player:getMark("joy__sunhanhua_ling") > 3 and player:usedSkillTimes(chongxu.name, Player.HistoryGame) == 0 and
    player:hasSkill(huiling, true)
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local x = math.min(player:getMark("joy__sunhanhua_ling"),#room.players)
    room:handleAddLoseSkills(player, "-joy__huiling", nil, true, false)
    room:changeMaxHp(player, x)
    room:handleAddLoseSkills(player, "taji|qinghuang", nil, true, false)
  end
})

return chongxu